class CalendarSeeker {
	public static void main(String[] args) {
		UserInput input = new UserInput();
		int[] date = input.getDate("Please enter date:");
		int temp_a;
		int temp_y;
		int temp_m;
		int weekDay;
		temp_a = (14 - date[1])/12;
		temp_y = date[2] - temp_a;
		temp_m = date[1] + 12 * temp_a - 2;
		weekDay = (7000 + (date[0] + temp_y + temp_y / 4 - temp_y / 100 + temp_y / 400 + 
					(31 * temp_m) / 12)) % 7;
		System.out.println(weekDay);
	}
}